package cn.enilu.flash.bean.constant.state;

import cn.hutool.core.io.IoUtil;
import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * @author qiang.lin
 * @ClassName YWTrackingStatus.java
 * @Description TODO
 * @createTime 2021年08月12日 16:18:00
 */
public enum YWTrackingStatus {
    OR10("订单已生成", "Order processed by shipper"),
    OR30("订单已取消", "Order cancelled by shipper"),
    PU10("燕文已揽收", "Yanwen Pickup Scan"),
    PU30("揽收失败", "Yanwen Pickup failed"),
    SC10("快件处理", "Processing information input"),
    SC20("离开燕文处理中心", "Yanwen facility - Outbound"),
    SC30("退件组包", "Returned by Yanwen"),
    SC35("快递退回或客户自取", "Returned by Yanwen, Process completed"),
    SC36("退件签收", "Returned by Yanwen, Delivered with signature"),
    SC37("退件件签收失败", "Returned by Yanwen, Delivered without signature"),
    SC40("目的国承运商：xxx，追踪单号：xxxx", "Destination country carrier：xxx， Parcel tracking number：xxx"),
    SC45("收到预录单电子信息", "Pre-shipment Info sent to carrier"),
    SC65("到达物流商仓库", "Carrier facility - Inbound"),
    SC70("离开物流商仓库", "Carrier facility - Outbound"),
    EC10("提交出口报关信息", "Customs declaration information - Export"),
    EC20("出口报关放行", "International shipment release - Export"),
    EC30("出口报关异常", "Custom clearance failed - Export"),
    LH10("航空/班轮/铁路公司接收", "Port of departure - Received by carrier"),
    LH20("航班起飞/班轮起航", "Port of departure - Departure"),
    LH21("中转港接收", "In transit - Arrival"),
    LH22("中转港起飞/起航", "In transit - Departure"),
    LH35("航班/班轮延误原因", "Flight/Voyage delay"),
    LH36("目的港接收", "Port of destination - Arrival"),
    LH40("到达物流商仓库", "Carrier facility - Inbound"),
    LH45("离开目的港", "Port of destination - Departure"),
    LH23("到达铁路运输途径站", "Enroute - Arrival"),
    LH24("离开铁路运输途径站", "Enroute - Departure"),
    LH26("到达铁路运输途径站", "Enroute - Arrival"),
    LH27("离开铁路运输途径站", "Enroute - Departure"),
    LH28("到达铁路运输途径站", "Enroute - Arrival"),
    LH29("离开铁路运输途径站", "Enroute - Departure"),
    LH30("到达铁路运输终点站", "Station of destination - Arrival"),
    LH31("离开铁路运输终点站", "Station of destination - Departure"),
    LH33("抵达目的地仓库", "LOCATION，Arrived at international hub"),
    IC50("开始进口清关", "Custom Clearance in process"),
    IC60("进口清关完成", "International shipment release - Import"),
    IC70("进口清关失败", "Custom clearance failed - Import"),
    LH50("到达派送目的国", "Destination Country - Arrival"),
    LM10("到达目的国派送处理中心", "LOCATION，Distribution center - Inbound"),
    LM11("离开目的国派送处理中心，开始转运", "LOCATION，Distribution center - Outbound"),
    LM15("目的国国内中转", "In transit to next facility"),
    LM12("包裹到达目的国中转中心", "In transit - Inbound"),
    LM13("包裹离开目的国中转中心", "In transit - Outbound"),
    LM20("到达目的国最后派送点", "Destination Scan"),
    LM25("离开目的国最后派送点", "Out for delivery"),
    LM40("派送成功/妥投/签收，POD", "Delivered with POD"),
    LM50("派送失败", "Delivery failed"),
    LM51("妥投失败，再次尝试投递", "Delivery attempt failed, will be arranged again"),
    LM52("妥投失败，收件人联系不上", "Delivery failed, Consignee is not available"),
    LM53("妥投失败，包裹损坏", "Delivery failed, Package damaged"),
    LM60("派送延迟", "Delivery delay"),
    LM61("预约派送", "Delivery delay and appointment"),
    LM65("签收延迟，会再次派送", "Sign-off delay and will be delivered again"),
    LM30("到达待取", "Available for pick up"),
    LM32("等待收件人支付关税", "Waiting for paying Duty"),
    LM70("需要进⼀步确认收件⼈信息", "Consignee information is required"),
    LM90("包裹退回", "Package returned"),
    LM91("派送失败，包裹退回到物流商", "Delivery failed and package returned to carrier"),
    LM92("派送失败，从海外退回", "Delivery failed and package returned from overseas"),
    LM93("派送失败，包裹退回，包裹损坏", "Delivery failed and return, package damaged"),
    LM75("收件⼈拒绝签收", "Sign-off refused by consignee"),
    LM76("包裹损坏，收件⼈拒绝签收", "Package damaged, consignee refused"),
    LM85("包裹丢失", "Package lost"),
    OTHER("其他信息", "OTHERS"),
    ;
    @Getter
    private String zhMsg, enMsg;

    YWTrackingStatus(String zhMsg, String enMsg) {
        this.zhMsg = zhMsg;
        this.enMsg = enMsg;
    }

    public static void main(String[] args) {
        ClassPathResource resource = new ClassPathResource("temp.txt");
        List<String> lines = new ArrayList<>();
        lines = IoUtil.readLines(resource.getReader(CharsetUtil.CHARSET_UTF_8), lines);
        for (String temp : lines) {
            String[] infos = temp.split("\t");
            System.out.println(StrUtil.trim(infos[0]) + "(\"" + StrUtil.trim(infos[1]) + "\",\"" + StrUtil.trim(infos[2]) + "\"),");
        }
    }
}
